﻿using System;

namespace _02_LinkedList
{
   class Program
   {
      static void Main(string[] args)
      {
         //MyLinkedList list = new MyLinkedList(new int[] { 1, 2, 3, 4, 5 });
         //list.PrintLinkedList();

         //MyLinkedList list = MyLinkedList.GenerateRandList(10);
         //list.PrintLinkedList();
         //Console.WriteLine();

         //list = list.ReverseLinkedList();
         //list.PrintLinkedList();

         //MyLinkedList copy = list.CopyLinkedList();
         //copy.PrintLinkedList();

         //MyLinkedList list1 = new MyLinkedList(new int[] { 5,4,3,2,1 });
         //MyLinkedList list2 = new MyLinkedList(new int[] { 5,3,2 });
         //MyLinkedList.PrintSamePart(list1.next, list2.next);

         //MyLinkedList list = new MyLinkedList(new int[] { 1, 2, 1 });
         //MyLinkedList.IsPalindrome_2(list.next);

         //MyLinkedList list = MyLinkedList.GenerateRandList(10);
         //list.PrintLinkedList();
         //Console.WriteLine();
         //list = MyLinkedList.Partition_2(list, 50);
         //list.PrintLinkedList();

         //RandList r1 = new RandList(1);
         //RandList r2 = new RandList(2);
         //RandList r3 = new RandList(3);
         //RandList r4 = new RandList(4);
         //r1.next = r2;
         //r2.next = r3;
         //r3.next = r4;
         //r1.rand = r4;
         //r2.rand = r4;
         //r3.rand = r1;

         //RandList copy = r1.CopyLinkedList();

         MyLinkedList l1 = new MyLinkedList(1);
         MyLinkedList l2 = new MyLinkedList(2);
         MyLinkedList l3 = new MyLinkedList(3);
         MyLinkedList l4 = new MyLinkedList(4);
         MyLinkedList l5 = new MyLinkedList(5);
         MyLinkedList l6 = new MyLinkedList(6);
         l1.next = l2;
         l2.next = l3;
         l3.next = l4;
         l4.next = l5;
         l5.next = l3;
         l6.next = l4;

         MyLinkedList.IsCross_2(l1, l6);
      }
   }
}
